package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class QualifiedJoin implements JoinedTable {

    private int beginIndex;
    private int endIndex;
    private TableReference tableReference0;
    private JoinType joinType;
    private TableReference tableReference1;
    private JoinSpecification joinSpecification;

    public QualifiedJoin(TableReference tableReference0,
                         JoinType joinType,
                         TableReference tableReference1,
                         JoinSpecification joinSpecification) {
        this.beginIndex = tableReference0.getBeginIndex();
        this.endIndex = joinSpecification.getEndIndex();
        this.tableReference0 = tableReference0;
        this.joinType = joinType;
        this.tableReference1 = tableReference1;
        this.joinSpecification = joinSpecification;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public TableReference getTableReference1() {
        return tableReference0;
    }

    public JoinType getJoinType() {
        return joinType;
    }

    public TableReference getTableReference2() {
        return tableReference1;
    }

    public JoinSpecification getJoinSpecification() {
        return joinSpecification;
    }

}
